﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using Golos.Helper;

namespace Golos.Tags.Http
{
    public partial class TagCacheServer
    {
        private void RemoveQuestionTags(HttpListenerContext context, ref int statusCode)
        {
            try
            {
                if (context.Request.QueryString.AllKeys.Contains("questionid"))
                {
                    Guid questionId = new Guid(context.Request.QueryString["questionid"]);
                    tagsCache.RemoveQuestionTags(questionId);
                    statusCode = (int)HttpStatusCode.OK;
                    return;
                }
                statusCode = (int)HttpStatusCode.BadRequest;
                return;
            }
            catch (Exception exception)
            {
                LogClass.WriteErrorEntry(exception.ToString());
                statusCode = (int)HttpStatusCode.InternalServerError;
            }
        }
    }
}
